﻿using System.Collections.Generic;
using System.Linq;
using BusinessLogic.Interfaces;
using Domain;
using Domain.Entities;

namespace BusinessLogic.Implementations
{
   public  class EFOrderStatusRepository :IOrderStatusRepository
    {
       private EFDbContext context;
       public EFOrderStatusRepository(EFDbContext context)
       {
           this. context = context;
       }
      
       public IEnumerable<OrderStatus> GetOrderStatuses()
       {
           return context.OrderStatuses.ToList();
       }

       public OrderStatus GetOrderStatusById(int id)
       {
           return context.OrderStatuses.FirstOrDefault(i => i.Id == id);
       }

    }
}
